package com.crm.model.jdao;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.crm.model.pojo.DetailedDemand;
import com.crm.model.pojo.QuotationRecord;

public interface IQuotationRecordDAO extends CrudRepository<QuotationRecord,Integer> {



		/**
		 * 带条件的分页，查询所有报价记录
		 * @param <T>
		 * @return
		 * 
		 */
	 
	 Page<QuotationRecord> findAll(Specification<QuotationRecord> spec,Pageable pageable);
	  
	  /**
	   * 统计对象个数
	   */
	  long count();
	  
	  /**
	   * 根据id查询报价记录
	   * @param salId
	   * @return
	   */
	  //QuotationRecord findByQd_recordId(Integer qd_recordId);
	  @Query("SELECT q FROM QuotationRecord q where q.qdRecordId=?1")
	  QuotationRecord queryByrecordId(Integer qd_recordId);
	  
	  /**
	   * 确认报价记录主题是否重复
	   * @param salThme
	   * @return
	   */
	  QuotationRecord findByQrTheme(String qrTheme);
}
